package lab02.Test36;

/**
 * Created by Administrator on 2017/11/16.
 */
abstract class Student {
    public String name;
    public String student_type;
    public String grade_level;
    public double[] course;
    double sum = 0;

    public double[] getCourse() {
        return course;
    }

    public void setCourse(double[] course) {
        this.course = course;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStudent_type() {
        return student_type;
    }

    public void setStudent_type(String student_type) {
        this.student_type = student_type;
    }

    public String avergage(double[] course) {//输出成绩等级
        for (int i = 0; i < 3; i++) {
            sum += course[i];
        }
        sum /= 3;
        if (sum > 80) {
            grade_level = "优秀！";
        } else if (sum > 70) {
            grade_level = "良好！";
        } else if (sum > 60) {
            grade_level = "一般！";
        } else if (sum > 50) {
            grade_level = "及格！";
        } else {
            grade_level = "不及格！";
        }
        return grade_level;
    }

}
